"""Add open_rrr and close_rrr columns to trades table

Revision ID: 03477dae3b69
Revises: c03e0a6b142b
Create Date: 2025-06-27 09:04:19.839837

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = '03477dae3b69'
down_revision: Union[str, None] = 'c03e0a6b142b'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    """Upgrade schema."""
    # Add open_rrr column to trades table
    op.add_column('trades', sa.Column('open_rrr', sa.Float(), nullable=True))
    # Add close_rrr column to trades table
    op.add_column('trades', sa.Column('close_rrr', sa.Float(), nullable=True))


def downgrade() -> None:
    """Downgrade schema."""
    # Remove close_rrr column from trades table
    op.drop_column('trades', 'close_rrr')
    # Remove open_rrr column from trades table
    op.drop_column('trades', 'open_rrr')
